home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
prog_bas
/
easynet.zip
/
DEMO.ZIP
/
NETWORK.FRM
< prev
next >
Wrap
Text File
|
1996-01-01
|
10KB
|
407 lines
VERSION 4.00
Begin VB.Form Form2
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "Example 2: NetWork"
ClientHeight = 4545
ClientLeft = 1095
ClientTop = 1830
ClientWidth = 6270
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 700
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 4950
Left = 1035
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 4545
ScaleWidth = 6270
Tag = "2"
Top = 1485
Width = 6390
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 525
Index = 2
Left = 4110
Picture = "NETWORK.frx":0000
ScaleHeight = 495
ScaleWidth = 555
TabIndex = 3
Top = 3540
Visible = 0 'False
Width = 585
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 525
Index = 1
Left = 3510
Picture = "NETWORK.frx":030A
ScaleHeight = 495
ScaleWidth = 555
TabIndex = 2
Top = 3540
Visible = 0 'False
Width = 585
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 525
Index = 0
Left = 2910
Picture = "NETWORK.frx":0614
ScaleHeight = 495
ScaleWidth = 540
TabIndex = 1
Top = 3540
Visible = 0 'False
Width = 570
End
Begin VBX.EasyNet Net1
Alignment = 7 'Center - MIDDLE
AutoScroll = -1 'True
BackColor = &H00C0FFC0&
CanMultiLink = -1 'True
DrawColor = &H00FF0000&
DrawStyle = 6 'Inside Solid
DrawWidth = 1
FillColor = &H00F8FCF8&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 3375
Hiding = 0 'False
ImageFile = ""
Left = 810
License = "NETWORK.frx":091E
MultiSel = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Top = 90
Version = 183
Width = 5325
xGrid = 75
yGrid = 75
Begin VB.CommandButton Command5
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "&Next Stub"
BeginProperty Font
name = "MS Sans Serif"
charset = 1
weight = 400
size = 8.25
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 315
Left = 2100
TabIndex = 4
Top = 2640
Width = 855
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub banner2()
Dim id&, id1&, id2&, id3&, id4&
' No oriented links
Net1.Oriented = False
' Nodes are rectangular transparent shapes
Net1.Shape = 1
Net1.Transparent = True
Net1.EditAction = 0
Net1.Type = 1
Net1.X1 = 515
Net1.Y1 = 1700
Net1.X2 = 3600
Net1.Y2 = 1785
Net1.DrawStyle = 0
id = Net1.Item
Net1.Item = 0
Net1.FillColor = RGB(0, 0, 0)
Net1.EditAction = 0
Net1.Type = 2
Net1.X1 = 550
Net1.Y1 = 1725
Net1.X2 = 600
Net1.Y2 = 1775
id1 = Net1.Item
Net1.Owner = id
Net1.EditAction = 0
Net1.Type = 2
Net1.X1 = 1525
Net1.Y1 = 1725
Net1.X2 = 1575
Net1.Y2 = 1775
id2 = Net1.Item
Net1.Owner = id
Net1.EditAction = 0
Net1.Type = 2
Net1.X1 = 2450
Net1.Y1 = 1725
Net1.X2 = 2500
Net1.Y2 = 1775
id3 = Net1.Item
Net1.Owner = id
Net1.EditAction = 0
Net1.Type = 2
Net1.X1 = 3450
Net1.Y1 = 1725
Net1.X2 = 3500
Net1.Y2 = 1775
id4 = Net1.Item
Net1.Owner = id
Net1.Item = id
Net1.Data = id1
Net1.Item = id1
Net1.Data = id2
Net1.Sleeping = True
Net1.Item = id2
Net1.Data = id3
Net1.Sleeping = True
Net1.Item = id3
Net1.Data = id4
Net1.Sleeping = True
Net1.Item = id4
Net1.Data = id1
Net1.Sleeping = True
Net1.Item = 0
Net1.Transparent = True
Net1.Picture = Picture1(0).Picture
' First node
Net1.EditAction = 0
Net1.X1 = 275
Net1.Y1 = 400
Net1.X2 = 875
Net1.Y2 = 1100
Net1.Text = "Paul"
Net1.Picture = Picture1(1).Picture
Net1.Org = Net1.Item
Net1.Dst = id1
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
' Second node
Net1.EditAction = 0
Net1.X1 = 1200
Net1.Y1 = 200
Net1.X2 = 1900
Net1.Y2 = 900
Net1.Text = "Team 2"
Net1.Picture = Picture1(2).Picture
Net1.Org = Net1.Item
Net1.Dst = id2
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
' Third node
Net1.EditAction = 0
Net1.X1 = 2175
Net1.Y1 = 400
Net1.X2 = 2775
Net1.Y2 = 1100
Net1.Text = "Lisa"
Net1.Picture = Picture1(1).Picture
Net1.Org = Net1.Item
Net1.Dst = id3
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
' Fourth node
Net1.EditAction = 0
Net1.X1 = 3125
Net1.Y1 = 400
Net1.X2 = 3825
Net1.Y2 = 1100
Net1.Text = "George"
Net1.Picture = Picture1(1).Picture
Net1.Org = Net1.Item
Net1.Dst = id4
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
Net1.Item = 0
End Sub
Private Sub Command5_Click()
Dim Org&, Dst&
Org = Net1.Org
Dst = Net1.Dst
Net1.EditAction = 2
Net1.Item = Dst
Net1.Dst = Net1.Data
Net1.Org = Org
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
Command5.Enabled = True
End Sub
Private Sub Form_Activate()
ActivateForm
End Sub
Private Sub Form_Deactivate()
DeactivateForm
End Sub
Private Sub Form_Load()
MDI1.ShowExample(1).Enabled = False
MDI1.Command5.Enabled = False
SpeedON Net1
banner2
SpeedOFF Net1
End Sub
Private Sub Form_Resize()
If WindowState <> 1 And ScaleHeight <> 0 Then
Net1.Visible = False
Net1.Top = 0
Net1.Left = 0
Net1.Height = ScaleHeight
Net1.Width = ScaleWidth
Net1.Visible = True
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
MDI1.ShowExample(1).Enabled = True
Command5.Enabled = True
MDI1.Command5.Caption = "Comments "
End Sub
Private Sub Net1_AddLink()
Dim curItem&, Org&, Dst&, itemData&
Dim itemType%
curItem = Net1.Item
Org = Net1.Org
Dst = Net1.Dst
Net1.Item = Dst
itemType = Net1.Type
itemData = Net1.Data
Select Case itemType
Case 1
' Delete link
Net1.Item = curItem
Net1.EditAction = 2
' Look for first owned node
' Create a link towards this owned node
Net1.Dst = itemData ' First owned node
Net1.Org = Org
Net1.DoSelChange = False
Net1.DoAddLink = False
Net1.EditAction = 1
Net1.DrawColor = RGB(255, 0, 0)
Net1.DrawStyle = 0
Command5.Enabled = True
Net1.DoSelChange = True
Net1.DoAddLink = True
Case Else
Net1.Item = curItem
End Select
End Sub
Private Sub Net1_AddNode()
Net1.DrawStyle = 5 ' Invisible
Net1.Type = 0
' Force node size
Net1.Y2 = Net1.Y1 + 500
Net1.X2 = Net1.X1 + 500
End Sub
Private Sub Net1_DblClick()
If Net1.Item <> 0 And Not Net1.IsLink And Net1.Type = 0 Then
Legend = Net1.Text
If Net1.Picture = Picture1(0).Picture Then
Picnum = 0
ElseIf Net1.Picture = Picture1(1).Picture Then
Picnum = 1
Else
Picnum = 2
End If
AlignMent = Net1.AlignMent
frmAlign.Show 1
If Ok Then
Net1.Text = Legend
Net1.Picture = Picture1(Picnum).Picture
Net1.AlignMent = AlignMent
End If
End If
End Sub
Private Sub Net1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim l&
Select Case KeyCode
Case KEY_DELETE
Net1.EditAction = 2
Case KEY_LEFT
l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEUP, 0)
Case KEY_RIGHT
l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEDOWN, 0)
Case KEY_DOWN
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEDOWN, 0)
Case KEY_UP
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEUP, 0)
Case KEY_NEXT
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEDOWN, 0)
Case KEY_PRIOR
l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEUP, 0)
End Select
End Sub
Private Sub Net1_SelChange()
If Net1.Item <> 0 And Net1.IsLink And Net1.DrawColor = RGB(255, 0, 0) Then
Command5.Enabled = True
Else
Command5.Enabled = False
End If
End Sub